package taxi_map.model;

import java.math.BigDecimal;
import java.util.HashMap;

import org.springframework.orm.ibatis.SqlMapClientTemplate;

import to.WaitingDriverTO;

public class TaxiMapDAO {
	private SqlMapClientTemplate sqlMap;
	
	public TaxiMapDAO(SqlMapClientTemplate sqlMap){
		this.sqlMap = sqlMap;
	}
	
	public void insertWaitingDriver(WaitingDriverTO wto){
		sqlMap.insert("insertWaitingDriver", wto);
	}
	
	public void deleteWaitingDriver(String phoneNumber){
		sqlMap.delete("deleteWaitingDriver", phoneNumber);
	}
	
	public WaitingDriverTO findNearestWaitingDriver(HashMap<String,BigDecimal> condition){
		return (WaitingDriverTO) sqlMap.queryForObject("selectWaitingDriver", condition);
	}
}